<?php
// Filename : SI.g11n.Language.Korean.php
// Author : Cyrus Hackford (cyrus@cyrush.kr)
// Category : SI > Globalization(g11n) > Language > Korean

final class Hangul {
	
	public static function Disorganize($siclCodeInt) {
		$siclCodeInt-=44032;
		$siclJongInt=$siclCodeInt%28;
		$siclJoongInt=(($siclCodeInt-$siclJongInt)/28)%21;
		$siclChoInt=($siclCodeInt-(($siclJoongInt*28)+$siclJongInt))/588;
		
		return array($siclChoInt,$siclJoongInt,$siclJongInt);
	}
	
	public static function IsHangul($siclHangulChar) {
		$siclVerifierInt=UTF8::Char2Int($siclHangulChar);
		if($siclVerifierInt>=44032 && $siclVerifierInt<=55203)
			return true;
		
		return false;
	}
	
	public static function Organize($siclChoInt,$siclJoongInt,$siclJongInt) {
		return (($siclChoInt*588)+($siclJoongInt*28)+$siclJongInt)+44032;
	}
	
}

?>